class Puddle < ActiveRecord::Base
	#edited by entity relationship
	belongs_to :entity
	
	#puddleship relationship
	has_many :puddleships
	has_many :puddleMembers, :class_name => 'Entity', :through => :puddleships, :source => 'entity'

	def me
		return self
	end
	
	def change_name(newName)#Ethan
		self.update_attributes(:name => newName)
  end
  
  def add_entity(entity_id) #Created by Adrian
    Puddleship.create(:entity_id => entity_id, :puddle_id => self.id)
  end
	
end
